<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'addSingleStudent.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>

		<h1>
			<font color="red">添加单个学生</font>
		</h1>

		<s:form action="addSingleStudent">
			<s:textfield name="student.studentId" label="学号"></s:textfield>
			<s:textfield name="student.name" label="姓名"></s:textfield>
			<s:textfield name="student.college" label="学院"></s:textfield>
			<s:textfield name="student.teachingClass" label="班级"></s:textfield>
			<s:textfield name="student.registerNo" label="登记号"></s:textfield>
			<s:submit value="添加"></s:submit>
		</s:form>

		<s:form>

			<s:select label="最高学历" name="education" list="{'高中','大学','硕士','博士'}" />

		</s:form>

		<!-- Select标签 -->
		<hr size="3" color="blue">
		<b>Select标签输出一个下拉列表框，相当于HTML代码中的&lt;select/&gt;</b>
		<br>
		<i>使用name和list属性，list属性的值是一个列表:</i>
		<s:select label="最高学历" name="education" list="{'高中','大学','硕士','博士'}" />
		<br>
		<i>使用name和list属性，list属性的值是一个Map:</i>
		<s:select label="最高学历" name="education"
			list="#{1:'高中',2:'大学',3:'硕士',4:'博士'}" />
		<br>
		<i>使用headerKey和headerValue属性设置header选项:</i>
		<s:select label="最高学历" name="education" list="{'高中','大学','硕士','博士'}"
			headerKey="-1" headerValue="请选择您的学历" />
		<br>
		<i>使用multiple属性设置多选和使用size属性设置下拉框可显示的选项个数:</i>
		<s:select label="最高学历" name="education" list="{'高中','大学','硕士','博士'}"
			multiple="true" size="3" />
		<br>
		<span style="color: red;">
			使用listKey和listValue属性，利用Action实例的属性（property）来设置选项的值和选项的内容:
			&lt;s:select label="最高学历" name="education" list="educations"
			listKey="id" listValue="name"/&gt; </span>



	</body>
</html>
